package io.renren.modules.substation.service.impl;

import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.renren.common.utils.PageUtils;
import io.renren.common.utils.Query;

import io.renren.modules.substation.dao.TInfoEfenceInfoDao;
import io.renren.modules.substation.entity.TInfoEfenceInfoEntity;
import io.renren.modules.substation.service.TInfoEfenceInfoService;


@Service("tInfoEfenceInfoService")
public class TInfoEfenceInfoServiceImpl extends ServiceImpl<TInfoEfenceInfoDao, TInfoEfenceInfoEntity> implements TInfoEfenceInfoService {
    @Override
    public PageUtils queryPage(Map<String, Object> params) {

        String efenceCode = (String)params.get("efenceCode");
        String devCode = (String)params.get("devCode");
//        String selectArea = (String)params.get("selectArea");
        log.debug("efenceCode打印日志");
        log.debug(efenceCode);
        log.debug(devCode);
        IPage<TInfoEfenceInfoEntity> page = this.page(
                new Query<TInfoEfenceInfoEntity>().getPage(params),
                new QueryWrapper<TInfoEfenceInfoEntity>()
                        .like(StringUtils.isNotBlank(efenceCode),"EFENCE_CODE", efenceCode)
//                        .eq(efenceCode!=null&&!efenceCode.isEmpty(),"EFENCE_CODE",efenceCode)
                        .eq(devCode!=null&&!devCode.isEmpty(),"DEV_CODE",devCode)
//                        .eq(selectArea!=null&&!selectArea.isEmpty(),"selectArea",selectArea)
//                        .like(StringUtils.isNotBlank(efenceCode),"efenceCode", efenceCode)
        );

        return new PageUtils(page);
    }

}